import 'package:flutter/material.dart';
import 'package:ytbusiness/config/yt_theme.dart';
import 'package:ytbusiness/utils/helper.dart';
import 'package:ytbusiness/utils/screen_adaptation.dart';
import 'package:ytbusiness/widgets/widgets.dart';


///设置密码
class SetLoginPassword extends StatefulWidget {
  @override
  _SetLoginPasswordState createState() => _SetLoginPasswordState();
}

class _SetLoginPasswordState extends State<SetLoginPassword> {
  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () {
        print('隐藏键盘⌨️,隐藏键盘⌨️,');
        FocusScope.of(context).requestFocus(FocusNode());
      },
      child: Scaffold(
        appBar: customAppBar(context,title: "设置密码"),
        body: Container(
          color: Color(0xfff0f0f0),
          child: ListView(
            primary: false,
            children: [
              Container(
                margin: EdgeInsets.symmetric(vertical: setWidth(15)),
                padding: EdgeInsets.symmetric(horizontal: setWidth(15)),
                height: setWidth(60),
                color: Colors.white,
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Text(
                      '账号',
                      style: TextStyle(
                        color: Color(0xff989898),
                        fontSize: setSp(15),
                      ),
                    ),
                    Row(
                      children: [
                        Image.asset(
                          'assets/images/weChat_image.png',
                          width: setWidth(24),
                          height: setWidth(19.5),
                          fit: BoxFit.fill,
                        ),
                        SizedBox(
                          width: setWidth(5),
                        ),
                        Text(
                          '发呆业务爱好者',
                          style: TextStyle(
                            color: Color(0xff989898),
                            fontSize: setSp(15),
                          ),
                        ),
                      ],
                    ),
                  ],
                ),
              ),
              Container(
                padding: EdgeInsets.symmetric(horizontal: setWidth(15),),
                height: setWidth(120.5),
                color: Colors.white,
                child: Column(
                  children: [
                    Container(
                      height: setWidth(60),
                      child: Row(
                        children: [
                          Container(
                            width: setWidth(90),
                            alignment: Alignment.centerLeft,
                            child: Text(
                              '新密码',
                              style: TextStyle(
                                color: Color(0xff323232),
                                fontSize: setSp(15),
                              ),
                            ),
                          ),
                          Expanded(
                            child: TextField(
                              textAlign: TextAlign.right,
                              style: TextStyle(
                                fontSize: setSp(15),
                                color: Color(0xff333333),
                              ),
                              maxLines: 1,
                              textInputAction: TextInputAction.search,
                              onSubmitted: (str) {
                                print(' return  按钮点击事件  !!!!');
//                            dispatch(IdCardInformationActionCreator.refreshClickAction());
                              },
                              decoration: InputDecoration(
                                hintText: '请输入新密码',
                                hintStyle: TextStyle(
                                  color: Color(0xff989898),
                                  fontSize: setSp(15),
                                ),
                                contentPadding: EdgeInsets.only(
                                  left: setWidth(10),
                                  top: setWidth(10),
                                  bottom: setWidth(10),
                                ),
                                isDense:true,
                                border: InputBorder.none,
                                focusedBorder: InputBorder.none,
                                enabledBorder: InputBorder.none,
                              ),
                            ),
                          ),
                        ],
                      ),
                    ),
                    Container(
                      height: setWidth(0.5),
                      color: Color(0xfff0f0f0),
                    ),
                    Container(
                      height: setWidth(60),
                      child: Row(
                        children: [
                          Container(
                            width: setWidth(90),
                            alignment: Alignment.centerLeft,
                            child: Text(
                              '确认新密码',
                              style: TextStyle(
                                color: Color(0xff323232),
                                fontSize: setSp(15),
                              ),
                            ),
                          ),
                          Expanded(
                            child: TextField(
                              textAlign: TextAlign.right,
                              style: TextStyle(
                                fontSize: setSp(15),
                                color: Color(0xff333333),
                              ),
                              maxLines: 1,
                              textInputAction: TextInputAction.search,
                              onSubmitted: (str) {
                                print(' return  按钮点击事件  !!!!');
//                            dispatch(IdCardInformationActionCreator.refreshClickAction());
                              },
                              decoration: InputDecoration(
                                hintText: '请输入确认新密码',
                                hintStyle: TextStyle(
                                  color: Color(0xff989898),
                                  fontSize: setSp(15),
                                ),
                                contentPadding: EdgeInsets.only(
                                  left: setWidth(10),
                                  top: setWidth(10),
                                  bottom: setWidth(10),
                                ),
                                isDense:true,
                                border: InputBorder.none,
                                focusedBorder: InputBorder.none,
                                enabledBorder: InputBorder.none,
                              ),
                            ),
                          ),
                        ],
                      ),
                    ),
                  ],
                ),
              ),
              SizedBox(
                height: setWidth(100),
              ),
              InkWell(
                onTap: () {
                   toast('设置密码 完成');
                   urlPush(context, "yuntu://account_and_security");
                },
                child: Container(
                  height: setWidth(44),
                  margin: EdgeInsets.only(
                    left: setWidth(15),
                    right: setWidth(15),
                  ),
                  decoration: BoxDecoration(
                    color: YTTheme.theme,
                    borderRadius: BorderRadius.circular(setWidth(3)),
                  ),
                  alignment: Alignment.center,
                  child: Text(
                    '完成',
                    style: TextStyle(
                      color: Colors.white,
                      fontSize: setSp(15),
                    ),
                  ),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

